-- function add(a,b,c,...) end;
function add(...) 
    local s = 0
    for _,v in ipairs{...} do
        s = s + v
    end
    return s
end
print(add(1,2,3,4,5))
function id(...) 
    local arg = table.pack(...)
    for i=1, arg.n  do
       if(arg[i] == nil) then
            return false
       end
    end
    return ... 
end
print(id(1,2,3))
function fwrite(fmt,...)
    return io.write(string.format(fmt,...))
end
print(id(1,nil,nil))
print(select(1,1,2,3))
print(select(3,1,2,3))
print(select("#",1,2,3))
-- 参数少时效率高
function add_second(...)
    local s = 0
    for i = 1,select("#",...) do
        s = s + select(i,...)
    end
end